from fastapi import APIRouter

from app.dependencies.depend_db import with_db_session
from app.models_entity import TestBaseEntity
from app.routers import BaseRouter


class RoutersTest(BaseRouter):

    def set_router(self):
        self.router = APIRouter(prefix="/users", tags=["users"])

        self.router.add_api_route("/", self.read_root, methods=["GET"])
        self.router.add_api_route(
            "/items/{item_id}", self.read_item, methods=["GET"])
 
    async def read_root(self): 
        aa = TestBaseEntity().create(self.db_session)
        return aa

    async def read_item(self, item_id: int):
        return {"item_id": item_id}
